package org.hawk.gwtppc.webtest.tests.methodsuite;

import org.hawk.gwtppc.webtest.common.Asserts;
import org.hawk.gwtppc.webtest.common.Test;
import org.hawk.gwtppc.webtest.tests.mock.GenericClassMock;
import org.hawk.gwtppc.webtest.tests.mock.SubClassMock2;

public class ToStringAndGenericStringTest implements Test {

	public void run() throws Throwable {
		Asserts.assertEquals(SubClassMock2.class.getDeclaredMethod("processValue").toString(), 
				"public void org.hawk.gwtppc.webtest.tests.mock.SubClassMock2.processValue()");
		Asserts.assertEquals(SubClassMock2.class.getDeclaredMethod("processValue", int.class).toGenericString(), 
				"protected final int org.hawk.gwtppc.webtest.tests.mock.SubClassMock2.processValue(int)");
		Asserts.assertEquals(SubClassMock2.class.getDeclaredMethod("processValue", int.class, Object.class).toString(), 
				"java.lang.Object org.hawk.gwtppc.webtest.tests.mock.SubClassMock2.processValue(int,java.lang.Object)");
		Asserts.assertEquals(GenericClassMock.class.getDeclaredMethod("getSomeValue", Object.class, Object.class, 
				Class.class).toString(), "public java.lang.Object org.hawk.gwtppc.webtest.tests.mock.GenericClassMock." +
						"getSomeValue(java.lang.Object,java.lang.Object,java.lang.Class)");
		Asserts.assertEquals(GenericClassMock.class.getDeclaredMethod("getSomeValue", Object.class, Object.class, 
				Class.class).toGenericString(), "public <T> T org.hawk.gwtppc.webtest.tests.mock.GenericClassMock." +
						"getSomeValue(X3,X2,java.lang.Class<T>)");
	}

	public String getName() {
		return "toString()";
	}

}
